<template>
	<view class="comment">
		<view class="comment-list" v-for="item in reply" :key="item.id" @click="replayMsglev(item)">
			<view class="comment-list_box">
				<img :src="item.avatar" />
				<view class="comment-list_content">
					<text class="comment-list_content--author">{{ item.author }} <text>回复</text> {{ item.pName }} </text>
					<text class="comment-list_content--text">{{ item.text }}</text>
					<view class="comment-list_content--icon">
						<view>
							<text class="tn-icon-time tn-color-cyan" style="padding: 10rpx;"></text>
							<text>{{ item.createTime }}</text>
						</view>
						<view>
							<text class="tn-icon-time tn-color-cyan" style="padding: 10rpx;"></text>
							<text>{{ item.address }}</text>
						</view>
					</view>
				</view>
			</view>
			<reply v-if="item.children && item.children.length > 0" :reply="item.children"/>
		</view>
	</view>
</template>

<script>
	
	export default {
		name:"reply",
		props:{
			reply:{
				type:Array,
				default:()=> { return [] }
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			replayMsglev(item){
				this.$emit('replayMsglev',item)
			}
		},
	}
</script>

<style lang="scss">
.comment{
	&-list {
		margin-bottom: 30rpx;
		&_box{
			display: flex;
			align-items: flex-start;
			margin-bottom: 30rpx;
			img{
				width: 60rpx;
				height: 60rpx;
				border-radius: 50%;
				margin-right: 20rpx;
			}
		}
		&_content{
			display: flex;
			flex-direction: column;
			&--author{
				font-size: 26rpx;
				color: #C6D1D8;
				margin-bottom: 20rpx;
				text{
					margin: 0 40rpx;
					color: $tn-color-cyan;
				}
			}
			&--text{
				font-size: 28rpx;
				margin-bottom: 20rpx;
			}
			&--icon{
				display: flex;
				justify-content: flex-start;
				font-size: 26rpx;
				color: #C6D1D8;
				view{
					margin-right: 40rpx;
				}
				
			}
		}
	}
}
</style>